<!--
	Desc: 	参数管理的编辑界面
	Author: caochaofeng
	Date: 	2019-04-10 17:20:53
-->

<template>
  <el-dialog
    v-loading="dialogLoading"
    :title="!dataForm.id ? '新增参数' : '修改参数'"
    :close-on-click-modal="false"
    :append-to-body="true"
    :visible.sync="visible"
    width="60%"
    top="8vh">
    <el-form v-loading="formLoading" ref="dataForm" :model="dataForm" :size="size" label-width="100px" @keyup.enter.native="dataFormSubmit()">
      <el-form-item :rules="$rulesFilter({required:true})" label="参数编码" prop="paramCode">
        <el-input v-model="dataForm.paramCode" placeholder="参数编码"/>
      </el-form-item>
      <el-form-item :rules="$rulesFilter({required:true})" label="参数值" prop="paramValue">
        <el-input v-model="dataForm.paramValue" placeholder="参数值"/>
      </el-form-item>
      <el-form-item :rules="$rulesFilter({required:true})" label="类型" prop="paramType">
        <el-radio-group v-model="dataForm.paramType">
          <el-radio :label="0">系统参数</el-radio>
          <el-radio :label="1">非系统参数</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="dataForm.remark" placeholder="备注"/>
      </el-form-item>

    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import mixinFormViewModule from '@/mixins/form-view-module'
import * as API from '@/api/sys/params'

export default {
  mixins: [mixinFormViewModule],
  data() {
    return {
      visible: false,
      dataForm: {
        id: 0,
        paramCode: '',
        paramValue: '',
        paramType: '',
        remark: '',
        creator: '',
        createDate: '',
        updater: '',
        updateDate: ''
      },
      mixinViewModuleOptions: {
        getInfoAPI: API.info, // 数据详情列表接口，API地址

        addAPI: API.add, // 新增接口，API地址
        updateAPI: API.update // 修改接口，API地址
      }
    }
  },
  methods: {
  }
}
</script>
